var t = getApp();

Page({
    data: {
        loading: !0,
        list: [],
        title: "",
        current_page: 1,
        isLoadMore: !0,
        last_page: 0
    },
    onLoad: function(t) {
        this.getData();
    },
    gotoUrl: function(t) {
        var a = t.currentTarget.dataset.link;
        if (a) try {
            wx.navigateTo({
                url: a
            });
        } catch (t) {
            wx.reLaunch({
                url: a
            });
        }
    },
    getData: function() {
        var a = this, e = t.getNetAddresss("plugin.tg-decorate.frontend.app.search");
        t._postNetWork({
            url: e,
            data: {
                title: this.data.title
            },
            success: function(e) {
                var n = e.data;
                1 == n.result ? a.setData({
                    loading: !1,
                    list: n.data.data,
                    current_page: n.data.current_page,
                    last_page: n.data.last_page
                }) : t.tips(n.msg);
            },
            fail: function(t) {}
        });
    },
    getMore: function() {
        var a = this, e = {
            page: this.data.page + 1,
            title: this.data.title
        }, n = t.getNetAddresss("plugin.tg-decorate.frontend.app.search");
        t._getNetWork({
            url: n,
            data: e,
            success: function(e) {
                var n = e.data;
                1 == n.result ? a.setData({
                    list: that.data.list.concat(n.data.data.data),
                    current_page: n.data.current_page,
                    last_page: n.data.last_page,
                    page: a.data.page + 1
                }) : t.tips(n.msg);
            },
            fail: function(t) {}
        });
    },
    changeKeyword: function(t) {
        this.setData({
            title: t.detail
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});